import * as employeesApi from '@/api/employees'

const state = {
  employeesList: {
    rows: [],
    total: 0
  }
}
const mutations = {
  SET_EMPLOYEES_LIST: (state, newValue) => {
    state.employeesList = newValue
  }
}
const actions = {
  async updateEmployeesList({ commit }, params) {
    const res = await employeesApi.getEmployeesList(params)
    commit('SET_EMPLOYEES_LIST', res)
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
